package cn.java.exercises;

public class SelectStructure
{
    public static void main(String[] args)
    {
        String strName;     //申请人姓名
        String strGender;   //申请人性别
        String strTitle;    //申请人称谓
        int nAge;           //申请人年龄

        strName="胡八一";
        strGender="男";
        nAge=28;
        strTitle="";

        if(nAge >=7 && nAge <=18)
        {
            strTitle = strName + "同学";
        }
        else if(nAge >=19 && nAge <=60)
        {
            if(strGender =="男")
            {
                strTitle=strName+"先生";
            }
            else
            {
                strTitle=strTitle=strName+"女士";
            }
        }
        else if(nAge >=61)
        {
            if(strGender =="男")
            {
                strTitle=strName+"大伯";
            }
            else
            {
                strTitle=strTitle=strName+"大妈";
            }
        }
        System.out.println("申请人姓名："+strName+",性别："+strGender+",年龄:"+nAge);
        System.out.println("申请人称谓："+strTitle);

    }
}
